﻿using Microsoft.IdentityModel.Tokens;
using MyProject.Core;
using System.ComponentModel.DataAnnotations;


namespace MyProject.Entities.ListItem
{
    public class ListItem(string name, int p_id = 0, string? alias = null, int? id = null) : NotifyPropertyChanged
    {
        public int? id { get; set; } = id ?? null;

        [Required(ErrorMessage = "Поле является обязательным"), MaxLength(100)]
        public string name { get; set; } = name;
        public string? alias { get; set; } = alias;
        public int p_id { get; set; } = p_id;
        public override string ToString() => $"{name}";
    }
}
